import { View } from "../../../../mvc/core/View";
import { GTextFormat } from "../../../../common/GTextFormat";
import { FontUtil } from "../../../../common/font/FontUtil";
import { Dispatcher } from "../../../../mvc/core/Dispatcher";
import { GuildEventName } from "../GuildEventName";
import { EventName } from "../../../mvc/EventName";
import { GButton } from "../../../../../com/mui/controls/GButton";
import { EOperOption } from "../../../../../Message/Game/EOperOption";
import { DataEvent } from "../../../events/DataEvent";
import { ObjCreate } from "../../common/ObjCreate";
import { Cache } from "../../../cache/Cache";
import { ENpcEffect } from "../../../../../Message/Public/ENpcEffect";
import { EGuildPosition } from "../../../../../Message/Game/EGuildPosition";
import { Language } from "../../../../../extend/language/Language";
import { GlobalStyle } from "../../../../common/global/GlobalStyle";
import { GuildRoomIcon } from "./GuildRoomIcon";
import { ImagesConst } from "../../../resource/ImagesConst";
import { GTextArea } from "../../../../../com/mui/controls/GTextArea";
import { GameConst } from "../../../../component/gconst/GameConst";
import { ScrollPolicy } from "../../../../../flashx/textLayout/container/ScrollPolicy";
import { ParamsConst } from "../../../../common/global/ParamsConst";
import { ProxyType } from "../../../../common/global/ProxyType";
import { BaseItem } from "../../common/BaseItem";
import { ResFileConst } from "../../../resource/ResFileConst";
import { GImageBitmap } from "../../../../../com/mui/controls/GImageBitmap";
import { SGuildInfo } from "../../../../../Message/Game/SGuildInfo";
import { GuildConfig } from "../../../resource/GuildConfig";
import { GuildUtil } from "../info/GuildUtil";
import { GameDefConfig } from "../../../resource/GameDefConfig";
import { SPlayerGuildInfo } from "../../../../../Message/Game/SPlayerGuildInfo";
import { GuildAwardConfig } from "../../../resource/GuildAwardConfig";
import { ItemData } from "../../../resource/info/ItemData";
import { FilterConst } from "../../../../component/gconst/FilterConst";
import { FilterText } from "../../../../../com/gengine/utils/FilterText";
import { MsgManager } from "../../../manager/MsgManager";
import { AIManager } from "../../../scene/ai/AIManager";
import { AIType } from "../../../scene/ai/AIType";
import { GuildwarEnterWindow } from "../../guildWar/GuildwarEnterWindow";
import { GLoadedButton } from "../../../../../com/mui/controls/GLoadedButton";
import { GameController } from "../../../mvc/GameController";
import { ChatManager } from "../../chat/chatPrivate/ChatManager";
import { FlyToNavbarTool } from "../../award/FlyToNavbarTool";
import { Alert } from "../../../../../com/mui/controls/Alert";
import { BuyAlert } from "../../pet/BuyAlert";
import { EPrictUnit } from "../../../../../Message/Public/EPrictUnit";
import { GuildPosDescWindow } from "../GuildPosDescWindow";
import { LayerManager } from "../../../manager/LayerManager";
import { GuildStrategyPlanWindow } from "../GuildStrategyPlanWindow";
import { GTextFiled } from "../../../../../com/mui/controls/GTextFiled";
import { GLabel } from "../../../../../com/mui/controls/GLabel";
import { TaskTargetInfo } from "../../../model/TaskTargetInfo";
import { ScaleBitmap } from "../../../../../com/mui/display/ScaleBitmap";
import { GTextInput } from "../../../../../com/mui/controls/GTextInput";
type int = number;
//class GuildInfoPanel
    
    export  class GuildInfoPanel extends View
    {
        constructor()
        {
            super();
            this._labelTf = new GTextFormat(FontUtil.songtiName, 12, 16777215);
            this._npcInfoArray = [];
            this.init();
            this.initRight();
            this.registerToolTip();
            Dispatcher.addEventListener(GuildEventName.GuildModuleShow, this.onGuildModuleShowHandler);
            Dispatcher.addEventListener(EventName.GuildGetAwardSuccess, this.onGuildGetAwardSuccessHandler);
            return;
        }

        /* internal  */onYYEditBtnClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            var loc2=null;
            var loc3=null;
            var loc1=(arg1.target as GButton).name;
            if (loc1 != "qq") 
            {
                loc2 = EOperOption.convert(EOperOption._EOperOptionYY);
                loc3 = this._yyInput.text;
            }
            else 
            {
                loc2 = EOperOption.convert(EOperOption._EOperOptionQQ);
                loc3 = this._qqInput.text;
            }
            Dispatcher.dispatchEvent(new DataEvent(EventName.GuildChangeYYQQ, {"option": loc2, "number": loc3}));
            return;
        }

        /* internal  */init(): void
        {
            ObjCreate.createBg(0, 0, 255, 400, this);
            ObjCreate.createBg(260, 0, 400, 400, this);
            this._dailyTarget = Cache.instance.scene.getNpcByEffect(ENpcEffect._ENpcGuildDailyGift);
            this._buyManorTarget = Cache.instance.scene.getGuildBuyNpc()[0];
            this.createGuildInfoSprite();
            this.createMyInfoSprite();
            return;
        }

        /* internal  */initRight(): void
        {
            var loc1=Cache.instance.guild.myGuildInfo;
            if (loc1.position != EGuildPosition._EGuildLeader) 
            {
                if (loc1.position != EGuildPosition._EGuildDeputyLeader) 
                {
                    this._quitBtn.visible = true;
                    this._disbandBtn.visible = false;
                }
                else 
                {
                    this._quitBtn.visible = true;
                    this._disbandBtn.visible = false;
                }
            }
            else 
            {
                this._quitBtn.visible = false;
                this._disbandBtn.visible = true;
            }
            var loc2=Cache.instance.guild.isLeader();
            this._purposeTextInput.editable = loc2;
            this._purposeEditBtn.visible = loc2;
            this._qqEditBtn.visible = loc2;
            this._yyEditBtn.visible = loc2;
            this._yyInput.editable = loc2;
            this._qqInput.editable = loc2;
            this._sendBtn.visible = loc2;
            return;
        }

        /* internal  */createGuildInfoSprite(): void
        {
            var loc1=15;
            this._guildInfoSprite = new Object /* flash.display.Sprite */();
            ObjCreate.createGTextField(Language.getString(57141), loc1, 10, 100, 20, this._guildInfoSprite, this._labelTf);
            this._guildNameText = ObjCreate.createTextField("", 75, 10, 100, 20, this._guildInfoSprite, GlobalStyle.textFormat1);
            this._roomIcon = new GuildRoomIcon();
            this._roomIcon.x = 150;
            this._roomIcon.y = 5;
            this._guildInfoSprite.addChild(this._roomIcon);
            ObjCreate.createTextField(Language.getString(57142), loc1, 35, 100, 20, this._guildInfoSprite, this._labelTf);
            this._leaderNameText = ObjCreate.createTextField("", 75, 35, 100, 20, this._guildInfoSprite, GlobalStyle.textFormat1);
            ObjCreate.createTextField(Language.getString(57143), loc1, 60, 100, 20, this._guildInfoSprite, this._labelTf);
            this._campText = ObjCreate.createTextField("", 75, 60, 100, 20, this._guildInfoSprite, GlobalStyle.textFormat1);
            this._levelLabel = ObjCreate.createGTextField(Language.getString(57144), loc1, 85, 100, 20, this._guildInfoSprite, this._labelTf);
            this._levelText = ObjCreate.createTextField("", 75, 85, 100, 20, this._guildInfoSprite, GlobalStyle.textFormat1);
            ObjCreate.createTextField(Language.getString(57145), loc1, 110, 100, 20, this._guildInfoSprite, this._labelTf);
            this._memberText = ObjCreate.createTextField("", 75, 110, 100, 20, this._guildInfoSprite, GlobalStyle.textFormat1);
            ObjCreate.createTextField(Language.getString(57399), loc1, 135, 100, 20, this._guildInfoSprite, this._labelTf);
            this._roomLevelTxt = ObjCreate.createTextField("", 75, 135, 100, 20, this._guildInfoSprite, GlobalStyle.textFormat1);
            this._updateRoomBtn = ObjCreate.createGButton(Language.getString(57400), 130, 132, 70, 24, this._guildInfoSprite);
            this._updateRoomBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onUpdateRoomBtnClickHandler);
            this._moneyLabel = ObjCreate.createGTextField(Language.getString(57146), loc1, 160, 100, 20, this._guildInfoSprite, this._labelTf);
            this._moneyText = ObjCreate.createTextField("", 75, 160, 100, 20, this._guildInfoSprite, GlobalStyle.textFormat1);
            ObjCreate.createTextField(Language.getString(57147), loc1, 185, 100, 20, this._guildInfoSprite, this._labelTf);
            this._qqInput = ObjCreate.createGTextInput(75, 185, this.getInputWidth(), 20, this._guildInfoSprite);
            this._qqInput.restrict = this.getInputRestrict();
            this._qqInput.maxChars = this.getInputMaxChar();
            this._qqEditBtn = ObjCreate.createGButton(Language.getString(57148), 190, 182, 60, 24, this._guildInfoSprite);
            this._qqEditBtn.name = "qq";
            this._qqEditBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onYYEditBtnClickHandler);
            ObjCreate.createTextField(Language.getString(57149), loc1, 210, 100, 20, this._guildInfoSprite, this._labelTf);
            this._yyInput = ObjCreate.createGTextInput(75, 210, this.getInputWidth(), 20, this._guildInfoSprite);
            this._yyInput.restrict = this.getInputRestrict();
            this._yyInput.maxChars = this.getInputMaxChar();
            this._yyEditBtn = ObjCreate.createGButton(Language.getString(57148), 190, 207, 60, 24, this._guildInfoSprite);
            this._yyEditBtn.name = "yy";
            this._yyEditBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onYYEditBtnClickHandler);
            ObjCreate.createBg(0, 245, 255, 28, this._guildInfoSprite, ImagesConst.RbListHeader);
            ObjCreate.createTextField(Language.getString(57150), 100, 250, 100, 40, this._guildInfoSprite, new GTextFormat("", 14, 15788607));
            this._purposeTextInput = new GTextArea();
            this._purposeTextInput.maxChars = GameConst.GuildPurposeLimit;
            this._purposeTextInput.styleName = "GTextArea";
            this._purposeTextInput.textField.wordWrap = true;
            this._purposeTextInput.width = 245;
            this._purposeTextInput.height = 95;
            this._purposeTextInput.x = 5;
            this._purposeTextInput.y = 275;
            this._purposeTextInput.verticalScrollPolicy = ScrollPolicy.AUTO;
            this._guildInfoSprite.addChild(this._purposeTextInput);
            this._purposeEditBtn = ObjCreate.createGButton(Language.getString(57151), 170, 370, 70, 24, this._guildInfoSprite);
            this._purposeEditBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onPurposeEditBtnClickHandler);
            this.addChild(this._guildInfoSprite);
            return;
        }

        /* internal  */getInputRestrict(): string
        {
            var loc1="0-9";
            if (ParamsConst.instance.proxyType == ProxyType.TW) 
            {
                loc1 = null;
            }
            return loc1;
        }

        /* internal  */getInputMaxChar(): int
        {
            var loc1=12;
            if (ParamsConst.instance.proxyType == ProxyType.TW) 
            {
                loc1 = 8;
            }
            return loc1;
        }

        /* internal  */getInputWidth(): number
        {
            var loc1=90;
            if (ParamsConst.instance.proxyType == ProxyType.TW) 
            {
                loc1 = 110;
            }
            return loc1;
        }

        /* internal  */createMyInfoSprite(): void
        {
            var loc1=15;
            this._myInfoSprite = new Object /* flash.display.Sprite */();
            this._myInfoSprite.x = 260;
            ObjCreate.createBg(0, 0, 400, 28, this._myInfoSprite, ImagesConst.RbListHeader);
            ObjCreate.createTextField(Language.getString(57152), 175, 5, 100, 40, this._myInfoSprite, new GTextFormat("", 14, 15788607));
            ObjCreate.createGTextField(Language.getString(57153), loc1, 45, 100, 20, this._myInfoSprite, this._labelTf);
            this._positionText = ObjCreate.createGTextField("", 118, 45, 100, 20, this._myInfoSprite, GlobalStyle.textFormat1);
            this._posDescTxt = ObjCreate.createGTextField("", 325, 35, 100, 20, this._myInfoSprite, GlobalStyle.textFormat6);
            this._posDescTxt.htmlText = Language.getString(57596);
            this._posDescTxt.addEventListener(flash.events.TextEvent.LINK, this.onPosDescClickHandler);
            this._strategyTxt = ObjCreate.createGTextField("", 325, 65, 100, 20, this._myInfoSprite, GlobalStyle.textFormat6);
            this._strategyTxt.htmlText = "<a href=\'event: 0\'><u>" + Language.getString(57659) + "</u></a>";
            this._strategyTxt.addEventListener(flash.events.TextEvent.LINK, this.onStrategyLinkHandler);
            this._contributionLabel = ObjCreate.createGTextField(Language.getString(57154), loc1, 75, 100, 20, this._myInfoSprite, this._labelTf);
            this._contributionText = ObjCreate.createGTextField("", 118, 75, 100, 20, this._myInfoSprite, GlobalStyle.textFormat1);
            this._welfareLabel = ObjCreate.createGTextField(Language.getString(57155), loc1, 105, 105, 20, this._myInfoSprite, this._labelTf);
            this._drawWelfareLabel = ObjCreate.createTextField("", 118, 105, 250, 20, this._myInfoSprite, GlobalStyle.textFormat1);
            this._drawWelfareLabel.autoSize = flash.text.TextFieldAutoSize.LEFT;
            ObjCreate.createBg(265, 90, 38, 38, this._myInfoSprite, ImagesConst.ItemBg);
            ObjCreate.createTextField(Language.getString(57156), 270, 95, 100, 50, this._myInfoSprite);
            this._giftbagItem = new BaseItem();
            this._giftbagItem.isDragAble = false;
            this._giftbagItem.setSize(32, 32);
            this._giftbagItem.move(267, 92);
            this._myInfoSprite.addChild(this._giftbagItem);
            this._drawBtn = ObjCreate.createGButton(Language.getString(57157), 325, 95, 70, 24, this._myInfoSprite);
            this._drawBtn.visible = true;
            this._drawBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onDrawBtnClickHandler);
            this._btnSignUpGuildWar = ObjCreate.createGLoadedButton(ResFileConst.guildwarSignUp, loc1, 135, 73, 23, this._myInfoSprite);
            this._btnSignUpGuildWar.toolTipData = Language.getString(41888);
            this._btnSignUpGuildWar.addEventListener(flash.events.MouseEvent.CLICK, this.onClickSignUpGuildWar);
            ObjCreate.createBg(0, 160, 400, 28, this._myInfoSprite, ImagesConst.RbListHeader);
            ObjCreate.createTextField(Language.getString(57158), 175, 165, 100, 165, this._myInfoSprite, new GTextFormat("", 14, 15788607));
            ObjCreate.createTextField(Language.getString(57159), 15, 200, 400, 20, this._myInfoSprite, new GTextFormat("", 12, 65280));
            this._backManorBtn = ObjCreate.createGButton(Language.getString(57160), 318, 230, 70, 24, this._myInfoSprite);
            this._backManorBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onBackManorBtnClickHandler);
            this._partyBtn = ObjCreate.createGButton(Language.getString(57414), 235, 230, 70, 24, this._myInfoSprite);
            this._partyBtn.toolTipData = Language.getString(57425);
            this._partyBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onPartyBtnClickHandler);
            this._treeBtn = ObjCreate.createGButton(Language.getString(57479), 152, 230, 70, 24, this._myInfoSprite);
            this._treeBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onTreeBtnClickHandler);
            this._copyBtn = ObjCreate.createGButton(Language.getString(60400), 69, 230, 70, 24, this._myInfoSprite, "ButtonRed");
            this._copyBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onCopyBtnClickHandler);
            this._taskBtn = ObjCreate.createGLoadedButton("GuildBigButton", 10, 255, 102, 92, this._myInfoSprite);
            this._taskBtn.name = "task";
            this._taskBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onFuncBtnClickHandler);
            var loc2=new GImageBitmap("GuildTaskLabel.png", 30, 272);
            this._myInfoSprite.addChild(loc2);
            this._contriBtn = ObjCreate.createGLoadedButton("GuildBigButton", 105, 255, 102, 92, this._myInfoSprite);
            this._contriBtn.name = "contri";
            this._contriBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onFuncBtnClickHandler);
            var loc3=new GImageBitmap("GuildContriLabel.png", 125, 272);
            this._myInfoSprite.addChild(loc3);
            this._shopBtn = ObjCreate.createGLoadedButton("GuildBigButton", 200, 255, 102, 92, this._myInfoSprite);
            this._shopBtn.name = "shop";
            this._shopBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onFuncBtnClickHandler);
            var loc4=new GImageBitmap("GuildShopLabel.png", 220, 272);
            this._myInfoSprite.addChild(loc4);
            this._warehouseBtn = ObjCreate.createGLoadedButton("GuildBigButton", 295, 255, 102, 92, this._myInfoSprite);
            this._warehouseBtn.name = "warehouse";
            this._warehouseBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onFuncBtnClickHandler);
            var loc5=new GImageBitmap("GuildWarehouseLabel.png", 315, 272);
            this._myInfoSprite.addChild(loc5);
            this._impeachBtn = ObjCreate.createGButton(Language.getString(57402), 69, 365, 70, 24, this._myInfoSprite);
            this._impeachBtn.name = "impeach";
            this._impeachBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onGButtonFunClickHandler);
            this._sendBtn = ObjCreate.createGButton(Language.getString(57161), 152, 365, 70, 24, this._myInfoSprite);
            this._sendBtn.name = "send";
            this._sendBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onGButtonFunClickHandler);
            this._chatBtn = ObjCreate.createGButton(Language.getString(57162), 235, 365, 70, 24, this._myInfoSprite);
            this._chatBtn.name = "chat";
            this._chatBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onGButtonFunClickHandler);
            this._quitBtn = ObjCreate.createGButton(Language.getString(57163), 318, 365, 70, 24, this._myInfoSprite);
            this._quitBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onQuitBtnClickHandler);
            this._disbandBtn = ObjCreate.createGButton(Language.getString(57164), 318, 365, 70, 24, this._myInfoSprite);
            this._disbandBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onDisbandBtnClickHandler);
            this.addChild(this._myInfoSprite);
            return;
        }

        public updateGuildInfo(arg1: SGuildInfo): void
        {
            var loc1=null;
            this._guildInfo = arg1;
            if (arg1) 
            {
                loc1 = GuildConfig.instance.getConfigByLevel(arg1.level);
                if (loc1 == null) 
                {
                    return;
                }
                this._guildNameText.text = arg1.guildName;
                this._roomIcon.level = arg1.house;
                this._roomIcon.x = this._guildNameText.x + this._guildNameText.textWidth + 10;
                this._updateRoomBtn.toolTipData = this.getUpdateRoomBtnTips(arg1.house);
                this._leaderNameText.text = arg1.leader.name;
                this._levelText.text = arg1.level.toString();
                this._memberText.text = arg1.playerNum.toString() + "/" + (loc1.maxNum + GuildUtil.getRoomNumByLevel(arg1.house));
                this._roomLevelTxt.text = arg1.house.toString();
                this._campText.text = GameDefConfig.instance.getECamp(arg1.camp);
                this._moneyText.text = arg1.money.toString() + "/" + arg1.maxMoney.toString();
                this._yyInput.text = arg1.YY;
                this._qqInput.text = arg1.QQ;
                this._purposeTextInput.htmlText = "<textFormat leading=\'5\'>" + arg1.purpose + "</textFormat>";
                this.initRight();
                if (this._strategyPlanWindow) 
                {
                    this._strategyPlanWindow.updateGuildInfo(arg1);
                }
            }
            return;
        }

        public updatePlayerInfo(arg1: SPlayerGuildInfo): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=null;
            var loc4=null;
            this._sPlayerGuildInfo = arg1;
            if (arg1) 
            {
                loc2 = GuildAwardConfig.instance.getConfigByLevel(arg1.level);
                loc1 = new ItemData(arg1.awardItemCode);
                if (loc1 && loc1.itemInfo) 
                {
                    this._giftbagItem.itemData = loc1;
                }
                else 
                {
                    this._giftbagItem.itemData = null;
                }
                if (loc2.items && loc2.items.length > 0) 
                {
                    this._giftbagItem.filters = [];
                    this._isCanDrawAwardbg = true;
                }
                else 
                {
                    this._giftbagItem.filters = [FilterConst.colorFilter];
                    this._isCanDrawAwardbg = false;
                }
                if (arg1.hadAward) 
                {
                    this._drawBtn.label = Language.getString(57165);
                    this._drawBtn.enabled = false;
                }
                else 
                {
                    this._drawBtn.label = Language.getString(57166);
                    this._drawBtn.enabled = true;
                }
                if (arg1.hallLevel != 0) 
                {
                    loc3 = "";
                    if (loc2) 
                    {
                        loc4 = GameDefConfig.instance.getEPrictUnitName(loc2.type);
                        this._drawWelfareLabel.text = loc2.value + "  " + loc4;
                    }
                }
                this._positionText.text = GameDefConfig.instance.getPositionName(arg1.position);
                this._contributionText.text = arg1.contribution.toString();
                if (this._guildInfo) 
                {
                    this._guildInfo.playerNum = arg1.playerNum;
                    this._guildInfo.level = arg1.level;
                    this._guildInfo.money = arg1.money;
                    this.updateGuildInfo(this._guildInfo);
                }
                this.initRight();
            }
            return;
        }

        /* internal  */onUpgradeBtnClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.GuildUpdate));
            return;
        }

        /* internal  */onPurposeEditBtnClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            var loc1=this._purposeTextInput.text;
            if (FilterText.instance.isHaveFilterTxt(loc1)) 
            {
                MsgManager.showRollTipsMsg(Language.getString(90136));
            }
            else 
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.GuildChangePurpose, loc1));
            }
            return;
        }

        /* internal  */onDrawWelfareClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            AIManager.onAutoPathAIControl(this._dailyTarget);
            return;
        }

        /* internal  */onQuitBtnClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.GuildQuit));
            return;
        }

        /* internal  */onDisbandBtnClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.GuildDisband));
            return;
        }

        /* internal  */onFlyBmpClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            AIManager.onAIControl(this._buyManorTarget, AIType.AI_Convey);
            return;
        }

        /* internal  */onBuyManorClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            AIManager.onAutoPathAIControl(this._buyManorTarget);
            return;
        }

        /* internal  */registerToolTip(): void
        {
            this._levelLabel.toolTipData = Language.getString(57167);
            this._moneyLabel.toolTipData = Language.getString(57168);
            this._yyEditBtn.toolTipData = Language.getString(57169);
            this._qqEditBtn.toolTipData = Language.getString(57170);
            this._purposeEditBtn.toolTipData = Language.getString(57171);
            this._contributionLabel.toolTipData = Language.getString(57172);
            this._welfareLabel.toolTipData = Language.getString(57173);
            this._backManorBtn.toolTipData = Language.getString(57174);
            return;
        }

        /* internal  */updateTaskNum(): void
        {
            var loc1=Cache.instance.daily.guildTaskInfo;
            if (this._taskNumTxt && loc1) 
            {
                this._taskNumTxt.text = "（" + loc1.num + "/" + loc1.totalNum + "）";
            }
            var loc2=Cache.instance.daily.runBussinessInfo;
            if (this._businessNumTxt && loc2) 
            {
                this._businessNumTxt.text = "（" + loc2.num + "/" + loc2.totalNum + "）";
            }
            return;
        }

        /* internal  */onGuildModuleShowHandler(arg1: DataEvent): void
        {
            this.updateTaskNum();
            return;
        }

        /* internal  */onDrawBtnClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.GuildGetAward));
            return;
        }

        /* internal  */onClickSignUpGuildWar(arg1: Object /* flash.events.MouseEvent */): void
        {
            GuildwarEnterWindow.instance.show();
            return;
        }

        /* internal  */onBackManorBtnClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.GuildEnterManor, {"guildId": Cache.instance.guild.myGuildInfo.guildId, "useContribution": true}));
            return;
        }

        /* internal  */onPartyBtnClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            if (Cache.instance.guild.isLeader()) 
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.GuildPartyWindowOpen));
            }
            else 
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.GuildPartyRewardWindowOpen));
            }
            return;
        }

        /* internal  */onTreeBtnClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.GuildOpenAuraWindow));
            return;
        }

        /* internal  */onCopyBtnClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.GuildOpenCopyWindow));
            return;
        }

        /* internal  */onFuncBtnClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            var loc1=arg1.target as GLoadedButton;
            var loc2=loc1.name;
            if (loc2 != "task") 
            {
                if (loc2 != "contri") 
                {
                    if (loc2 != "shop") 
                    {
                        if (loc2 == "warehouse") 
                        {
                            Dispatcher.dispatchEvent(new DataEvent(EventName.GuildWarehouseOpen));
                            GameController.guildWarehouse.isWarehouseOpenByNpc = false;
                        }
                    }
                    else 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.GuildOpenShop));
                    }
                }
                else 
                {
                    Dispatcher.dispatchEvent(new DataEvent(GuildEventName.OpenGuildContriWindow));
                }
            }
            else 
            {
                Dispatcher.dispatchEvent(new DataEvent(GuildEventName.OpenGuildTaskGuideWindow));
            }
            return;
        }

        /* internal  */onGButtonFunClickHandler(arg1: Object /* flash.events.Event */): void
        {
            var loc1=arg1.target as GButton;
            var loc2=loc1.name;
            if (loc2 != "send") 
            {
                if (loc2 != "chat") 
                {
                    if (loc2 == "impeach") 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.GuildImpeachWindowOpen));
                    }
                }
                else 
                {
                    ChatManager.addGuildChatWindow(true);
                }
            }
            else 
            {
                Dispatcher.dispatchEvent(new DataEvent(GuildEventName.OpenMassSendWindow));
            }
            return;
        }

        /* internal  */onGuildGetAwardSuccessHandler(arg1: DataEvent): void
        {
            if (this._isCanDrawAwardbg) 
            {
                FlyToNavbarTool.flyToBackPack(this._giftbagItem.bitmapdata, this._myInfoSprite.localToGlobal(new Object /* flash.geom.Point */(this._giftbagItem.x, this._giftbagItem.y)));
            }
            return;
        }

        /* internal  */onUpdateRoomBtnClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            var e: Object /* flash.events.MouseEvent */;
            var myGuildInfo: SPlayerGuildInfo;
            var isEnough: Boolean;
            var toLevel: int;
            var cost: int;
            var htmlContent: string;
            var onClickHandler: Function;

            var loc1;
            isEnough = false;
            cost = 0;
            onClickHandler = null;
            e = arg1;
            onClickHandler = (arg1: int): void
            {
                if (arg1 == Alert.OK) 
                {
                    isEnough = BuyAlert.checkMoney(EPrictUnit._EPriceUnitGold, cost);
                    if (isEnough) 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.GuildUpgradeRoom, onUpdateRoomSuccessHandler));
                    }
                    Alert.resetToDefault();
                }
                return;
            }
            if (this._guildInfo.house == 6) 
            {
                MsgManager.showRollTipsMsg(Language.getString(57401));
                return;
            }
            myGuildInfo = Cache.instance.guild.myGuildInfo;
            if (!(myGuildInfo.position == EGuildPosition._EGuildLeader) && !(myGuildInfo.position == EGuildPosition._EGuildDeputyLeader)) 
            {
                MsgManager.showRollTipsMsg(Language.getString(57394));
                return;
            }
            toLevel = this._guildInfo.house + 1;
            cost = GuildUtil.getRoomCostByLevel(toLevel);
            htmlContent = Language.getStringByParam(57395, cost, toLevel);
            Alert.show(htmlContent, null, Alert.OK | Alert.CANCEL, null, onClickHandler);
            return;
        }

        /* internal  */onUpdateRoomSuccessHandler(): void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.GuildGetInfo));
            MsgManager.showRollTipsMsg(Language.getString(57396));
            return;
        }

        /* internal  */getUpdateRoomBtnTips(arg1: int): string
        {
            var loc1=null;
            if (arg1 == 6) 
            {
                return Language.getString(57401);
            }
            var loc2=arg1 + 1;
            var loc3=GuildUtil.getRoomCostByLevel(loc2);
            loc1 = Language.getStringByParam(57397, loc3, loc2);
            return "<font color=\'#ffffff\'>" + loc1 + "</font>";
        }

        /* internal  */onPosDescClickHandler(arg1: Object /* flash.events.Event */): void
        {
            if (!this._posDescWindow) 
            {
                this._posDescWindow = new GuildPosDescWindow(LayerManager.windowLayer);
            }
            if (this._sPlayerGuildInfo) 
            {
                this._posDescWindow.updateLevel(this._sPlayerGuildInfo.level);
            }
            this._posDescWindow.show();
            return;
        }

        /* internal  */onStrategyLinkHandler(arg1: Object /* flash.events.TextEvent */): void
        {
            if (this._strategyPlanWindow == null) 
            {
                this._strategyPlanWindow = new GuildStrategyPlanWindow(LayerManager.windowLayer);
            }
            this._strategyPlanWindow.show();
            Dispatcher.dispatchEvent(new DataEvent(EventName.GuildGetInfo, 0));
            if (this._guildInfo) 
            {
                this._strategyPlanWindow.updateGuildInfo(this._guildInfo);
            }
            return;
        }

        /* internal */ /* var */_strategyTxt: GTextFiled;

        /* internal */ /* var */_contributionLabel: GTextFiled;

        /* internal */ /* var */_contributionText: GTextFiled;

        /* internal */ /* var */_contributionTotalLabel: GLabel;

        /* internal */ /* var */_contributionTotalText: GTextFiled;

        /* internal */ /* var */_welfareLabel: GTextFiled;

        /* internal */ /* var */_drawWelfareLabel: Object /* flash.text.TextField */;

        /* internal */ /* var */_drawBtn: GButton;

        /* internal */ /* var */_btnSignUpGuildWar: GLoadedButton;

        /* internal */ /* var */_giftbagItem: BaseItem;

        /* internal */ /* var */_taskLabel: GLabel;

        /* internal */ /* var */_taskNumTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_businessTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_businessNumTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_otherSetLabel: GLabel;

        /* internal */ /* var */_quitBtn: GButton;

        /* internal */ /* var */_treeBtn: GButton;

        /* internal */ /* var */_taskBtn: GLoadedButton;

        /* internal */ /* var */_contriBtn: GLoadedButton;

        /* internal */ /* var */_shopBtn: GLoadedButton;

        /* internal */ /* var */_warehouseBtn: GLoadedButton;

        /* internal */ /* var */_impeachBtn: GButton;

        /* internal */ /* var */_sendBtn: GButton;

        /* internal */ /* var */_chatBtn: GButton;

        /* internal */ /* var */_posDescWindow: GuildPosDescWindow;

        /* internal */ /* var */_strategyPlanWindow: GuildStrategyPlanWindow;

        /* internal */ /* var */_labelTf: Object /* flash.text.TextFormat */;

        /* internal */ /* var */_valueColor: uint=11661311;

        /* internal */ /* var */_guildInfo: SGuildInfo;

        /* internal */ /* var */_sPlayerGuildInfo: SPlayerGuildInfo;

        /* internal */ /* var */_dailyTarget: TaskTargetInfo;

        /* internal */ /* var */_buyManorTarget: TaskTargetInfo;

        /* internal */ /* var */_npcInfoArray: Array<any>;

        /* internal */ /* var */_isCanDrawAwardbg: Boolean;

        /* internal */ /* var */_guildInfoSprite: Object /* flash.display.Sprite */;

        /* internal */ /* var */_guildInfoBg: ScaleBitmap;

        /* internal */ /* var */_guildNameLabel: GLabel;

        /* internal */ /* var */_guildNameText: Object /* flash.text.TextField */;

        /* internal */ /* var */_roomIcon: GuildRoomIcon;

        /* internal */ /* var */_leaderNameLabel: GLabel;

        /* internal */ /* var */_leaderNameText: Object /* flash.text.TextField */;

        /* internal */ /* var */_levelLabel: GTextFiled;

        /* internal */ /* var */_levelText: Object /* flash.text.TextField */;

        /* internal */ /* var */_backManorBtn: GButton;

        /* internal */ /* var */_partyBtn: GButton;

        /* internal */ /* var */_copyBtn: GButton;

        /* internal */ /* var */_memberLabel: GLabel;

        /* internal */ /* var */_memberText: Object /* flash.text.TextField */;

        /* internal */ /* var */_roomLevelTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_updateRoomBtn: GButton;

        /* internal */ /* var */_campLabel: GLabel;

        /* internal */ /* var */_campText: Object /* flash.text.TextField */;

        /* internal */ /* var */_moneyLabel: GTextFiled;

        /* internal */ /* var */_moneyText: Object /* flash.text.TextField */;

        /* internal */ /* var */_yyInput: GTextInput;

        /* internal */ /* var */_disbandBtn: GButton;

        /* internal */ /* var */_qqInput: GTextInput;

        /* internal */ /* var */_qqEditBtn: GButton;

        /* internal */ /* var */_yyEditBtn: GButton;

        /* internal */ /* var */_purposeLabel: GLabel;

        /* internal */ /* var */_purposeTextInput: GTextArea;

        /* internal */ /* var */_purposeEditBtn: GButton;

        /* internal */ /* var */_myInfoSprite: Object /* flash.display.Sprite */;

        /* internal */ /* var */_myInfoBg: ScaleBitmap;

        /* internal */ /* var */_personLabel: GLabel;

        /* internal */ /* var */_positionLabel: GLabel;

        /* internal */ /* var */_positionText: GTextFiled;

        /* internal */ /* var */_posDescTxt: Object /* flash.text.TextField */;
    }
